package com.cisdi.echarts;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DatatipOption extends Option {
    /** 数据提示面板 **/
    private List<Object> datatips;

    /**
     * 获取datatip值
     */
    public List<Object> datatips() {
        if (this.datatips == null) {
            this.datatips = new ArrayList<Object>();
        }
        return this.datatips;
    }

    /**
     * 设置datatip值
     *
     * @param values
     * @return this
     */
    public Option datatips(Object... values) {
        if (values == null || values.length == 0) {
            return this;
        }
        this.datatips().addAll(Arrays.asList(values));
        return this;
    }
}
